import 'package:cbec_app/generated/json/base/json_convert_content.dart';
import 'package:cbec_app/entity/home/home_widget_activity_entity.dart';

HomeWidgetActivityEntity $HomeWidgetActivityEntityFromJson(Map<String, dynamic> json) {
  final HomeWidgetActivityEntity homeWidgetActivityEntity = HomeWidgetActivityEntity();
  final int? activityType = jsonConvert.convert<int>(json['activityType']);
  if (activityType != null) {
    homeWidgetActivityEntity.activityType = activityType;
  }
  final int? endTime = jsonConvert.convert<int>(json['endTime']);
  if (endTime != null) {
    homeWidgetActivityEntity.endTime = endTime;
  }
  final int? startTime = jsonConvert.convert<int>(json['startTime']);
  if (startTime != null) {
    homeWidgetActivityEntity.startTime = startTime;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    homeWidgetActivityEntity.status = status;
  }
  return homeWidgetActivityEntity;
}

Map<String, dynamic> $HomeWidgetActivityEntityToJson(HomeWidgetActivityEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['activityType'] = entity.activityType;
  data['endTime'] = entity.endTime;
  data['startTime'] = entity.startTime;
  data['status'] = entity.status;
  return data;
}

extension HomeWidgetActivityEntityExtension on HomeWidgetActivityEntity {
  HomeWidgetActivityEntity copyWith({
    int? activityType,
    int? endTime,
    int? startTime,
    int? status,
  }) {
    return HomeWidgetActivityEntity()
      ..activityType = activityType ?? this.activityType
      ..endTime = endTime ?? this.endTime
      ..startTime = startTime ?? this.startTime
      ..status = status ?? this.status;
  }
}
